home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50b Issue 142 (CD142b) (August 1998).iso / handson / Java / SCAdventure / AboutDlg.java next >
Encoding:
Java Source  |  1998-04-29  |  4.2 KB  |  166 lines

  1. /**
  2.  * 
  3.  * You can add code anywhere in this file - except in the areas that are
  4.  * written by the editor. You should not change the relative ordering of
  5.  * the code.
  6.  * 
  7.  * You can remove this comment block or replace it with another.
  8.  * 
  9.  * @see        
  10.  * @version    
  11.  * @author    
  12.  */
  13.  
  14. import java.awt.*;
  15. import java.awt.event.*;
  16. import java.beans.*;
  17. import java.io.*;
  18. import java.net.*;
  19. import java.util.*;
  20. import com.supercede.forms.*;
  21.  
  22. public class AboutDlg extends SuperCedeDialog implements Serializable
  23. {
  24.  
  25.     void aboutDlgPreInit()
  26.     {
  27.         // You can add code anywhere in this method.
  28.         // This method is called PRIOR to form initialization.
  29.         // NOTE: The form has NOT been initialized yet. Do not modify the form itself in this method.
  30.     }
  31.  
  32.     void aboutDlgPostInit()
  33.     {
  34.         // You can add code anywhere in this method.
  35.         // This method is called AFTER form initialization.
  36.     }
  37.  
  38.     public boolean aboutDlgWindowClosing(WindowEvent arg0)
  39.     {
  40.         // Put event handler code here. Return false for normal processing, true to override
  41.  
  42.         return false;
  43.     }
  44.  
  45.     public boolean aboutDlgWindowClosed(WindowEvent arg0)
  46.     {
  47.         // Put event handler code here. Return false for normal processing, true to override
  48.  
  49.         return false;
  50.     }
  51.  
  52.     public void button1MouseClicked(MouseEvent arg0)
  53.     {
  54.         setVisible(false);
  55.         dispose();
  56.     }
  57.  
  58.     // SuperCede Begin 2.0 Form Members
  59.     // Do not remove the Begin and End markers.
  60.     // The editor will rewrite the contents of this section each time the form is saved.
  61.  
  62.     // References to Beans within the Form.
  63.  
  64.     Button button1;
  65.     Label label1;
  66.  
  67.     private void SuperCedeConstructor() throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException
  68.     {
  69.         // Construct the actual connectors to give to our base class.
  70.  
  71.         Vector connectors = new Vector(3);
  72.         connectors.addElement(new AboutDlgWindowClosingConnector0(this));
  73.         connectors.addElement(new AboutDlgWindowClosedConnector1(this));
  74.         connectors.addElement(new AboutDlgEventConnector2(this));
  75.  
  76.         super.initializeThis(connectors);
  77.  
  78.         // Make references to Beans within the Form.
  79.  
  80.         int i = 0;
  81.  
  82.         button1 = (Button) getComponent(i++);
  83.         label1 = (Label) getComponent(i++);
  84.     }
  85.  
  86.     public AboutDlg(Frame parent) throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException
  87.     {
  88.         super(parent);
  89.  
  90.         aboutDlgPreInit();
  91.         SuperCedeConstructor();
  92.         aboutDlgPostInit();
  93.     }
  94.  
  95.     public void SuperCedeWindowClosing(WindowEvent arg0)
  96.     {
  97.         if (aboutDlgWindowClosing(arg0) == false)
  98.         {
  99.             dispose();
  100.         }
  101.     }
  102.  
  103.     public void SuperCedeWindowClosed(WindowEvent arg0)
  104.     {
  105.         aboutDlgWindowClosed(arg0);
  106.     }
  107.  
  108.     // SuperCede End 2.0 Form Members
  109. }
  110.  
  111. // SuperCede Begin 2.0 Form Connectors
  112. // Do not remove the Begin and End markers.
  113. // The editor will rewrite the contents of this section each time the form is saved.
  114. // Connections for AboutDlg:
  115. //    AboutDlgWindowClosingConnector0: from AboutDlg.windowClosing to AboutDlg.SuperCedeWindowClosing
  116. //    AboutDlgWindowClosedConnector1: from AboutDlg.windowClosed to AboutDlg.SuperCedeWindowClosed
  117. //    AboutDlgEventConnector2: from button1.mouseClicked to AboutDlg.button1MouseClicked
  118.  
  119. final class AboutDlgWindowClosingConnector0 extends WindowAdapter implements SuperCedeConnector, Serializable
  120. {
  121.     private AboutDlg target;
  122.  
  123.     public AboutDlgWindowClosingConnector0(AboutDlg target)
  124.     {
  125.         this.target = target;
  126.     }
  127.  
  128.     public void windowClosing(WindowEvent arg0)
  129.     {
  130.         target.SuperCedeWindowClosing(arg0);
  131.     }
  132. }
  133.  
  134. final class AboutDlgWindowClosedConnector1 extends WindowAdapter implements SuperCedeConnector, Serializable
  135. {
  136.     private AboutDlg target;
  137.  
  138.     public AboutDlgWindowClosedConnector1(AboutDlg target)
  139.     {
  140.         this.target = target;
  141.     }
  142.  
  143.     public void windowClosed(WindowEvent arg0)
  144.     {
  145.         target.SuperCedeWindowClosed(arg0);
  146.     }
  147. }
  148.  
  149. final class AboutDlgEventConnector2 extends MouseAdapter implements SuperCedeConnector, Serializable
  150. {
  151.     private AboutDlg target;
  152.  
  153.     public AboutDlgEventConnector2(AboutDlg target)
  154.     {
  155.         this.target = target;
  156.     }
  157.  
  158.     public void mouseClicked(MouseEvent arg0)
  159.     {
  160.         target.button1MouseClicked(arg0);
  161.     }
  162. }
  163.  
  164. // The following line must be the last line in the file.
  165. // SuperCede End 2.0 Form Connectors
  166.